home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6350 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.1 KB  |  57 lines

  1. Path: pcc002.ids-scheer.de!news
  2. From: Thomas Trenz <trenz@ids-scheer.de>
  3. Newsgroups: comp.lang.c++
  4. Subject: Is there a tool for exception-checking?
  5. Date: Fri, 09 Feb 1996 09:26:49 +0000
  6. Organization: IDS Prof. Scheer GmbH
  7. Message-ID: <311B1359.41B1@ids-scheer.de>
  8. NNTP-Posting-Host: pcg133.ids-scheer.de
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0b6a (WinNT; I)
  13.  
  14. Hi folks,
  15.  
  16. Is there a tool, that can check a projects throw-statements.
  17. For example:
  18.  
  19. class A
  20. {
  21. public:
  22.  
  23.   int f () throw (B, C);
  24.   int g () throw (B);
  25. };
  26.  
  27.  
  28. int A :: f () throw (B, C)
  29. {
  30.   // some code that can throw either B or C...
  31. }
  32.  
  33. int A :: g () throw (B)
  34. {
  35.   f();
  36. }
  37.  
  38.  
  39. Raising an exception of type C in f() causes an runtime-
  40. error in g(), because g guarantees, that it only raises
  41. exceptions of type B.
  42.  
  43. So is there any tool, that can find these pitfalls?
  44.  
  45. Thanx in advance...
  46.  
  47.  
  48.  
  49. --------------------------------------------
  50. IDS Prof. Scheer
  51. Thomas Trenz
  52. Altenkesseler Strasse 20
  53. Gebaeude C2
  54. D - 66115 Saarbruecken
  55.  
  56. Telefon: 0681 / 9921-850
  57.